<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<!DOCTYPE html>
<html>
	<head>
		<title>我的购物车</title>
		<%@include file="/common/header.jsp" %>
		<link rel="stylesheet" href="${basePath }css/detail.css" />
		
	</head>
	<body>
		<%@include file="/common/top.jsp" %>
		
		<div class="_container">
			<s:hidden id="orderId" name="order.id"></s:hidden>
			<div class="_title">
				订单号：<span style="color:#FF4400;"><s:property value="order.id"/> (<s:property value="order.status"/>)</span> 　&nbsp;&nbsp;
				下单时间：<s:date name="order.time" format="yyyy-MM-dd hh:mm"/>
			</div>
			<div class="_table">
				<h4>收件人:<s:property value="order.consignee"/></h4>			
				<h4>收件地址:<s:property value="order.address"/></h4>	
				<hr />
				<h4>商品清单 </h4>	
				<div class="_table_main">
					<table class="table table-condensed">
						<tr style="background-color: #EFEAE5;">
							<th>商品名称</th>
							<th>商品图片</th>
							<th>单价</th>	
							<th>数量</th>
							<th>小计</th>
						</tr>
						 <s:iterator value="order.orderItems" status="st">
							<tr>
								<td style="vertical-align: middle;width: 300px;"><s:property value="good.name"/></td>
								<td ><img src="${basePath }img/goods/<s:property value="good.img"/>" class="img-thumbnail" width="80" height="80" border="1"></td>
								<td style="vertical-align: middle;">￥<s:property value="good.price"/></td>
								<td style="vertical-align: middle;"><s:property value="quantity"/></td>
								<td style="vertical-align: middle;">￥<s:property value="price"/></td>
							</tr>
						</s:iterator>
						<tr>
							<td style="text-align: center;">
								<button class="_returnbtn" onclick="history.go(-1)">返回</button>
								<s:if test="order.status == '已发货'">
									<button class="_returnbtn" onclick="doGain()">确认收货</button>
								</s:if>
							</td>
							
							<td colspan="4" style="text-align: right;padding-right: 20px;font-size: 16px;">总金额: <s:property value="order.sumPrice"/></td>
						</tr>
					</table>
				</div>
			</div><!--/table-->
	   	</div> <!-- /container -->
	   	
		<%@include file="/common/footer.jsp" %>
		
		<script>
			function doGain(){
				var orderId = $('#orderId').val();
				window.location = "${basePath}order_doGain.action?order.id="+orderId;
			}
		</script>
	</body>
</html>
